package com.hyj.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hyj.entity.Readrooms;
import com.hyj.service.ReadService;



@Controller
public class ReadroomsController {
	
	@Autowired
	ReadService readService;
	
	@ResponseBody
	@RequestMapping("/getRead")
	public Object getRead(Readrooms read) {
		List<Readrooms> list =readService.getRead(read);
		read.setPage(null);
		read.setLimit(null);

		System.out.println("查得到资源全部数据" + list);
		Map<String, Object> map = new HashMap<String, Object>();
		List<Readrooms> list2 =readService.getRead(read);
		map.put("code", 0);
		map.put("msg", "资源列表");
		map.put("count", list2.size()); 
		map.put("data", list);
		return map;
	}
	
	
	
	

}
